;---------------------------------------------------------------------------
;Rat Knight Stand Summon (Entrance)
[Statedef 7000]
type    = A
movetype= I
physics = N
velset = ifelse(parent,FrontEdgeDist > 70,(ParentDist X)/15,((ParentDist X)-50)/15),-3.33*const(size.yscale)
ctrl = 0
anim = 7000
sprpriority = 3

[State 7000, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7000, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7000, 3]
type = Null
trigger1 = !Time && RoundState = 2
var(7) = -50-(50*(root,Var(0) > 0))

[State 7000, 4]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7000, 5]
type = Gravity
trigger1 = 1

[State 7000, 6]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7000, 7]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7000, 8]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7000, 9]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7200, 10]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7001
;---------------------------------------------------------------------------
;Rat Knight Stand Summon (Walk)
[Statedef 7001]
type    = S
movetype= I
physics = N
velset = 2*const(size.xscale),0
ctrl = 0
anim = 7001
sprpriority = 3

[State 7001, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7001, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7001, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7001, 3]
type = HitOverride
trigger1 = 1
attr = A,NA,SA,HA,HP
stateno = 7030
time = -1
slot = 0

[State 7001, 4]
type = HitOverride
trigger1 = 1
attr = SC,HA,HP
stateno = 7030
time = -1
slot = 1

[State 7001, 5]
type = HitOverride
trigger1 = 1
attr = SC,NA,SA
stateno = 7050
time = -1
slot = 2

[State 7001, 6]
type = HitOverride
trigger1 = 1
attr = SCA,NP,SP
stateno = 7050
time = -1
slot = 3

[State 7001, 7]
type = VarSet
trigger1 = !Time
var(0) = 7001

[State 7001, 8]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7001, 9]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7001, 10]
type = ChangeState
trigger1 = P2BodyDist X < 40
value = 7002
;---------------------------------------------------------------------------
;Rat Knight Stand Summon (Stab)
[Statedef 7002]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7002
sprpriority = 3

[State 7002, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7002, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7002, 3]
type = HitDef
trigger1 = root,var(5) < 10 && !Time
attr = S,NA
hitflag = MAF
guardflag = MA
animtype = Medium
priority = 4,Hit
damage = ceil(120*root,Fvar(21)),30
pausetime = 12,12
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-42*const(size.xscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 20
guard.slidetime = 17
ground.hittime = 22
guard.hittime = 19
ground.velocity = -4.2*const(size.xscale)
air.type = High
air.hittime = 24
air.velocity = -2.9*const(size.xscale), -2*const(size.yscale)
fall = 0
fall.recover = 0
yaccel = .35*const(size.xscale)
p1sprpriority = 3
p2sprpriority = -2
id = 7000
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7002, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7002, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7002, 6]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 0
persistent = 0

[State 7002, 7]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7002, 8]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7002, 9]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y

[State 7002, 10]
type = PlaySnd
trigger1 = AnimElem = 2
value = S7001,0

[State 7002, 11]
type = ChangeState
trigger1 = !AnimTime
value = 7020 
;---------------------------------------------------------------------------
;Rat Knight Stand Summon (Entrance)
[Statedef 7010]
type    = A
movetype= I
physics = N
velset = ifelse(parent,FrontEdgeDist > 70,(ParentDist X)/15,((ParentDist X)-50)/15),-3.33*const(size.yscale)
ctrl = 0
anim = 7000
sprpriority = 3

[State 7010, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7010, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7010, 3]
type = Null
trigger1 = !Time && RoundState = 2
var(7) = -50-(50*(root,Var(0) > 0))

[State 7000, 4]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7010, 5]
type = Gravity
trigger1 = 1

[State 7010, 6]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7010, 7]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7010, 8]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7010, 9]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7010, 10]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7011
;---------------------------------------------------------------------------
;Rat Knight Crouch Summon (Entrance)
[Statedef 7011]
type    = S
movetype= I
physics = N
velset = 2*const(size.xscale),0
ctrl = 0
anim = 7001
sprpriority = 3

[State 7011, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7011, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7011, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7011, 4]
type = HitOverride
trigger1 = 1
attr = A,NA,SA,HA,HP
stateno = 7030
time = -1
slot = 0

[State 7011, 5]
type = HitOverride
trigger1 = 1
attr = SC,HA,HP
stateno = 7030
time = -1
slot = 1

[State 7011, 6]
type = HitOverride
trigger1 = 1
attr = SC,NA,SA
stateno = 7050
time = -1
slot = 2

[State 7011, 7]
type = HitOverride
trigger1 = 1
attr = SCA,NP,SP
stateno = 7050
time = -1
slot = 3

[State 7011, 8]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7011, 9]
type = VarSet
trigger1 = !Time
var(0) = 7011

[State 7000, 10]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7011, 11]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7011, 12]
type = ChangeState
trigger1 = P2BodyDist X <= 60
value = 7012
;---------------------------------------------------------------------------
;Rat Knight Crouch Summon (Jump)
[Statedef 7012]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7012
sprpriority = 3

[State 7012, 1]
type = VelSet
trigger1 = AnimElem = 2
x = 3.58*const(size.xscale)
y = -3.13*const(size.yscale)

[State 7012, 2]
type = StateTypeSet
trigger1 = AnimElem = 2
statetype = A

[State 7012, 3]
type = VelAdd
trigger1 = AnimElemTime(2) >= 0
y = 0.3*const(size.yscale)

[State 7012, 4]
type = HitDef
trigger1 = root,var(5) < 10 && !Time
attr = A,NA
hitflag = MAF
guardflag = HA
animtype = Medium
priority = 4,Hit
damage = ceil(100*root,Fvar(21)),25
pausetime = 12,12
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-29*const(size.xscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 20
guard.slidetime = 17
ground.hittime = 22
guard.hittime = 19
ground.velocity = -4.5*const(size.xscale)
air.type = High
air.hittime = 24
air.velocity = -2.2*const(size.xscale), -1.7*const(size.yscale)
fall = 1
fall.recover = 0
p1sprpriority = 3
p2sprpriority = -2
yaccel = .35*const(size.yscale)
id = 7010
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7012, 5]
type = PlaySnd
trigger1 = AnimElem = 2
value = S40,0

[State 7012, 6]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 0
persistent = 0

[State 7012, 7]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7012, 8]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7012, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7012, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7012, 11]
type = PlaySnd
trigger1 = AnimElem = 2
value = S7011,0

[State 7012, 12]
type = PlaySnd
trigger1 = AnimElem = 4
value = S7011,1

[State 7012, 13]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 7013
;---------------------------------------------------------------------------
;Rat Knight Crouch (Land)
[Statedef 7013]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 7013
sprpriority = 3

[State 7013, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7013, 2]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7013, 3]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7013, 4]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7013, 5]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7013, 6]
type = ChangeState
trigger1 = !AnimTime
value = 7020 
;---------------------------------------------------------------------------
;Rat Knight Leave
[Statedef 7020]
type    = S
movetype= I
physics = N
velset = -2*const(size.xscale),0
ctrl = 0
anim = 7020
sprpriority = 3

[State 7020, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7020, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7020, 3]
type = Turn
trigger1 = !Time

[State 7020, 4]
type = ChangeState
trigger1 = FrontEdgeDist < -40*const(size.xscale)
value = 7300
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 7030]
type    = U
movetype= H
physics = N
velset = -4*const(size.xscale),0
ctrl = 0
anim = 7030
sprpriority = 3

[State 7030, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7030, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7030, 3]
type = ParentVarAdd
trigger1 = !Time 
var(6) = -100 && RoundState = 2
ignorehitpause = 1

[State 7030, 4]
type = VelAdd
trigger1 = StateType = A && Time > 24  
y = .3*const(size.yscale)
x
[State 7030, 5]
type = VelSet
trigger1 = Time = 24
x = 0

[State 7030, 6]
type = ChangeState
trigger1 = StateType = S && AnimElem = 19
trigger2 = StateType = A && Vel Y > 0 && Pos Y >= 0
value = 7031

[State 7030, 7]
type = PlaySnd
trigger1 = !Time
value = S7030,0

[State 7030, 8]
type = ChangeState
trigger1 = root,Var(6) = 0
value = 7040
;---------------------------------------------------------------------------
;Rat Knight Land
[Statedef 7031]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 7013
sprpriority = 3

[State 7031, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7031, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7031, 3]
type = PosSet
trigger1 = !Time
y = 0

[State 7031, 4]
type = NotHitBy
trigger1 = 1
value = SCA
time = -1

[State 7031, 5]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7031, 6]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7031, 7]
type = ChangeState
trigger1 = !AnimTime
value = 7020 
;---------------------------------------------------------------------------
;Rat Knight Defeated
[Statedef 7040]
type    = S
movetype= H
physics = N
sprpriority = -3
velset = 0,0
anim = 7040
ctrl = 0
sprpriority = 3

[State 7020, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7020, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7040, 2]
type = PlaySnd
trigger1 = !Time
value = S180,1

[State 7040, 3]
type = ChangeState
trigger1 = !AnimTime
value = 7300
;---------------------------------------------------------------------------
;Rat Knight Block
[Statedef 7050]
type    = S
movetype= I
physics = N
sprpriority = -3
velset = 0,0
anim = 7050
ctrl = 0
sprpriority = 3

[State 7050, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7050, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7050, 3]
type = ChangeState
trigger1 = !AnimTime
value = Var(0)
;---------------------------------------------------------------------------
;Bub Stand Summon (Entrance)
[Statedef 7100]
type    = A
movetype= I
physics = N
velset = Cond(parent,FrontEdgeDist > 50,((ParentDist X))/15,((ParentDist X))/15),-3.33*const(size.yscale)
ctrl = 0
anim = 7100
sprpriority = 3

[State 7100, 1]
type = Gravity
trigger1 = 1

[State 7100, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7100, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7100, 4]
type = Null
trigger1 = !Time && RoundState = 2
var(7) = -50-(50*(root,Var(0) > 0))

[State 7100, 5]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7100, 6]
type = PlaySnd
trigger1 = !Time
value = S7100,0

[State 7100, 7]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7100, 8]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7100, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7100, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7100, 11]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7101
;---------------------------------------------------------------------------
;Bub Stand Summon (Bubble)
[Statedef 7101]
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
anim = 7101
sprpriority = 3

[State 7100, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7100, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7101, 3]
type = PosSet
trigger1 = !Time
y = 0

[State 7101, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7101, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7101, 6]
type = Helper
trigger1 = AnimElem = 4
name = "Bubble"
ID = 7050
stateno = 7102
pos = ceil(10*const(size.xscale)),ceil(-16*const(size.yscale))
postype = p1
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7101, 7]
type = ParentVarAdd
trigger1 = AnimElem = 4
var(39) = 1

[State 7001, 8]
type = VarAdd
trigger1 = AnimElem = 4
var(11) = 1

[State 7101, 9]
type = StateTypeSet
trigger1 = Time = 31
movetype = A

[State 7101, 10]
type = StateTypeSet
trigger1 = Time = 33
movetype = I

[State 7101, 11]
type = PlaySnd
trigger1 = AnimElem = 4
value = S7101,0

[State 7001, 12]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7101, 13]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7101, 14]
type = ChangeState
trigger1 = Time = 90
value = 7120
;---------------------------------------------------------------------------
;Bubble
[Statedef 7102]
type    = S
movetype= A
physics = N
velset = 6*const(size.xscale),0
ctrl = 0
anim = 7102
sprpriority = 3

[State 7102, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7102, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7102, 3]
type = ParentVarSet
trigger1 = !Time
var(10) = 1

[State 7102, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7104
time = -1

[State 7102, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7102, 6]
type = HitDef
trigger1 = !Time
attr = S, SP
damage = ceil(50*root,Fvar(21)),5
animtype = Hard
getpower = 0,0
givepower = 25, 13
guardflag = MAF
hitflag = MAF
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = -1
guardsound = F6, 0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 24
ground.velocity = -8*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.velocity = -2.4*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.xscale)
fall = 1
fall.recover = 0
id = 7050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7102, 7]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7102, 8]
type = VarSet
triggerall = NumTarget && MoveHit && HitCount < 2
trigger1 = target,StateType = A && target,Time = 0
var(0) = 1
ignorehitpause = 1

[State 7102, 9]
type = VarSet
triggerall = NumTarget && Var(0) && HitCount < 2
trigger1 = target,Time
var(0) = 0
ignorehitpause = 1

[State 7102, 10]
type = TargetState
triggerall = NumTarget && MoveHit
trigger1 = HitPauseTime = 1
value = 7108
ignorehitpause = 1

[State 7102, 11]
type = ChangeState
triggerall = NumTarget && MoveHit
trigger1 = HitPauseTime = 1
value = 7105
ignorehitpause = 1

[State 7102, 12]
type = ChangeState
triggerall = !NumTarget && MoveHit
trigger1 = HitPauseTime = 1
value = 7104
ignorehitpause = 1

[State 7000, 13]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7000, 14]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7100, 15]
type = ChangeState
trigger1 = !AnimTime
value = 7103
;---------------------------------------------------------------------------
;Bubble
[Statedef 7103]
type    = S
movetype= I
physics = N
velset = 0,-1*const(size.yscale)
ctrl = 0
anim = 7103
sprpriority = 3

[State 7103, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7103, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7103, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7104
time = -1

[State 7103, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7103, 5]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7103, 6]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7103, 7]
type = ParentVarSet
trigger1 = !Time
var(10) = 1

[State 7103, 8]
type = ChangeState
trigger1 = ScreenPos Y < 50
value = 7104
;---------------------------------------------------------------------------
;Bubble
[Statedef 7104]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7104
sprpriority = 3

[State 7104, 1]
type = ScreenBound
trigger1 = 1
value = 1

[State 7104, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7104, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7104
time = -1

[State 7104, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7101, 5]
type = PlaySnd
trigger1 = !Time
value = S7104,0

[State 7000, 6]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7000, 7]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7000, 8]
type = DestroySelf
trigger1 = !AnimTime
;---------------------------------------------------------------------------
;Bubble
[Statedef 7105]
type    = S
movetype= I
physics = N
velset = 0,-.5*const(size.yscale)
ctrl = 0
anim = 7105
sprpriority = 3

[State 7105, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7105, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7105, 3]
type = TargetBind
trigger1 = 1
time = 1
id = -1
pos = 0,0

[State 7105, 4]
type = VarSet
triggerall = NumTarget && MoveHit && HitCount < 2 && !Var(0)
trigger1 = target,StateType = A && target,Time = 0
var(0) = 1
ignorehitpause = 1

[State 7105, 5]
type = VarSet
triggerall = NumTarget && Var(0)
trigger1 = target,Time
var(0) = 0
ignorehitpause = 1

[State 7105, 6]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7105, 7]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7105, 8]
type = ChangeState
trigger1 = target,StateNo != 7108
value = 7107

[State 7105, 9]
type = ChangeState
trigger1 = Time = 60
value = 7106
;---------------------------------------------------------------------------
;Bubble
[Statedef 7106]
type    = S
movetype= I
physics = N
velset = 0,-.5*const(size.yscale)
ctrl = 0
anim = 7106
sprpriority = 3

[State 7106, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7106, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7106, 3]
type = TargetBind
trigger1 = 1
time = 1
id = -1
pos = 0,0

[State 7006, 4]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7006, 5]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7006, 6]
type = VarSet
trigger1 = Time = 60
var(2) = 1

[State 7006, 7]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 7006, 8]
type = ChangeState
trigger1 = target,StateNo != 7108 || Time = 60
value = 7107
;---------------------------------------------------------------------------
;Bubble
[Statedef 7107]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7107
sprpriority = 3

[State 7107, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7107, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7107, 3]
type = TargetState
triggerall = NumTarget && Var(2)
trigger1 = !Time
value = 7109

[State 7107, 4]
type = PlaySnd
trigger1 = !Time
value = S7104,0

[State 7107, 5]
type = ParentVarSet
trigger1 = !Time
var(10) = 1

[State 7107, 6]
type = ChangeAnim
trigger1 = !AnimTime
value = 1

[State 7107, 7]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7107, 8]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7107, 9]
type = DestroySelf
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
;Bubble
[Statedef 7108]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0
sprpriority = 3

[State 7108, 1]
type = ChangeAnim2
trigger1 = !Time
value = 7108

[State 7108, 2]
type = ScreenBound
trigger1 = 1
value = 0
;---------------------------------------------------------------------------
;Bubble
[Statedef 7109]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0
sprpriority = 3

[State 7109, 1]
type = ChangeAnim
trigger1 = !Time
value = 5050

[State 7109, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7109, 3]
type = Gravity
trigger1 = 1

[State 7109, 4]
type = SelfState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 5100 

;---------------------------------------------------------------------------
;Bub Crouch Summon (Entrance)
[Statedef 7110]
type    = A
movetype= I
physics = N
velset = ifelse(parent,FrontEdgeDist > 70,((ParentDist X)+50)/15,(ParentDist X)/15),-3.33*const(size.yscale)
ctrl = 0
anim = 7100
sprpriority = 3

[State 7110, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7110, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7110, 3]
type = Gravity
trigger1 = 1

[State 7110, 4]
type = Null
trigger1 = !Time && RoundState = 2
var(7) = -50-(50*(root,Var(0) > 0))

[State 7110, 5]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7110, 6]
type = PlaySnd
trigger1 = !Time
value = S7100,0

[State 7111, 7]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7111, 8]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7100, 9]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7100, 10]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7000, 11]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7000, 12]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7110, 13]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7111
;---------------------------------------------------------------------------
;Bub Crouch Summon (Vomit)
[Statedef 7111]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7111
sprpriority = 3

[State 7111, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7110, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7110, 3]
type = PosSet
trigger1 = !Time
y = 0

[State 7110, 4]
type = Helper
trigger1 = AnimElem = 4
name = "Rainbow"
ID = 7050
stateno = 7112
pos = 0,0
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7110, 5]
type = ParentVarAdd
trigger1 = AnimElem = 4
var(39) = 1

[State 7001, 6]
type = VarAdd
trigger1 = AnimElem = 4
var(11) = 1

[State 7111, 7]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7111, 8]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7101, 9]
type = PlaySnd
trigger1 = AnimElem = 4
value = S7101,0

[State 7101, 10]
type = PlaySnd
trigger1 = AnimElem = 4
value = S7111,0

[State 7000, 11]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7000, 12]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7111, 13]
type = ChangeState
trigger1 = Time = 120
value = 7120
;---------------------------------------------------------------------------
;RAINBOWS
[Statedef 7112]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7112
sprpriority = 2

[State 7112, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7112, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7112, 3]
type = HitDef
trigger1 = !Time
attr = S, SP
damage = ceil(90*root,Fvar(21)),23
animtype = Hard
guardflag = MAF
hitflag = MAF-
getpower = 0
priority = 4, Hit
pausetime = 1,1
sparkno = S6001
sparkxy = -9,-31*floor(const(size.yscale))
hitsound = F5,2
guardsound = F6,0
ground.type = Low
ground.slidetime = 11
ground.hittime  = 22
ground.velocity = -6.4*const(size.xscale),-8.9*const(size.yscale)
ground.cornerpush.veloff = 0
air.type = Low
air.velocity = -6.1*const(size.xscale),-8.3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
p1stateno = 7114
id = 7050
chainID = -1
nochainID = -1
hitonce = 1
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7112, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7114
time = -1

[State 7112, 6]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7112, 8]
type = VarSet
triggerall = NumTarget && MoveHit && HitCount < 2
trigger1 = target,StateType = A && target,Time = 0
var(0) = 1
ignorehitpause = 1

[State 7112, 9]
type = VarSet
triggerall = NumTarget && Var(0)
trigger1 = target,Time
var(0) = 0
ignorehitpause = 1

[State 7112, 10]
type = TargetState
triggerall = NumTarget && MoveHit
trigger1 = target,StateType = A && HitPauseTime = 1
value = 7115
ignorehitpause = 1

[State 7112, 11]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7112, 12]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y

[State 7112, 13]
type = ChangeState
trigger1 = !AnimTime || MoveContact
value = 7113+(1*(MoveContact))
;---------------------------------------------------------------------------
;Rainbow Gone
[Statedef 7113]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 1
sprpriority = 3

[State 7113, 1]
type = TargetState
trigger1 = NumTarget && MoveHit && !Time
value = 7115
ignorehitpause = 1

[State 7113, 2]
type = ParentVarSet
trigger1 = !Time
var(10) = 1

[State 7113, 3]
type = DestroySelf
triggerall = Time
trigger1 = !NumTarget
trigger2 = NumTarget
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
;Rainbow Hit
[Statedef 7114]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7114
sprpriority = 2

[State 7114, 1]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7114, 2]
type = TargetState
trigger1 = NumTarget && MoveHit && !Time
value = 7115
ignorehitpause = 1

[State 7114, 3]
type = VarSet
triggerall = NumTarget && MoveHit && HitCount < 2 && !Var(0)
trigger1 = target,StateType = A && target,Time = 0
var(0) = 1
ignorehitpause = 1

[State 7114, 4]
type = VarSet
triggerall = NumTarget && Var(0)
trigger1 = target,Time
var(0) = 0
ignorehitpause = 1

[State 7114, 5]
type = ParentVarSet
trigger1 = !Time
var(10) = 1

[State 7114, 6]
type = ChangeAnim
trigger1 = !AnimTime 
value = 1

[State 7114, 7]
type = DestroySelf
triggerall = Time
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
;Rainbow Hit
[Statedef 7115]
type    = A
movetype= H
physics = N
velset = GetHitVar(xvel)*Facing,GetHitVar(yvel)
ctrl = 0
sprpriority = 2

[State 7115, 1]
type = ChangeAnim2
trigger1 = !Time
value = 7115

[State 7115, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 7115, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 7115, 4]
type = SelfState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 5100

;---------------------------------------------------------------------------
;Bub Leave
[Statedef 7120]
type    = S
movetype= I
physics = N
ctrl = 0
anim = 7120
sprpriority = 3

[State 7120, 1]
type = Turn
trigger1 = !Time

[State 7120, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7120, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7120, 4]
type = VelSet
trigger1 = !Time
x = 5.1*const(size.xscale)

[State 7120, 5]
type = VelAdd
trigger1 = 1
y = -.44*const(size.yscale)

[State 7120, 6]
type = PlaySnd
trigger1 = !Time
value = S7101,0

[State 7120, 7]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = -1

[State 7120, 8]
type = ChangeState
trigger1 = FrontEdgeDist < -30*const(size.xscale)
value = 7300

;---------------------------------------------------------------------------
; Bub Hit
[Statedef 7130]
type    = U
movetype= H
physics = N
ctrl = 0
anim = 7130
velset = -3*const(size.xscale),0
sprpriority = 3

[State 7130, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7130, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7130, 3]
type = ParentVarAdd
trigger1 = !Time 
var(6) = -100
ignorehitpause = 1

[State 7130, 4]
type = VelSet
trigger1 = StateType = A
y = 2*const(size.yscale)

[State 7130, 5]
type = VelSet
trigger1 = Time = 32
x = 0

[State 7130, 6]
type = ChangeState
trigger1 = StateType = S && AnimElem = 5
trigger2 = StateType = A && Vel Y > 0 && Pos Y >= 0
value = 7131

[State 7130, 7]
type = PlaySnd
trigger1 = !Time
value = S7130,0
channel = 6

[State 7130, 8]
type = ChangeState
trigger1 = root,Var(6) = 0
value = 7140
;---------------------------------------------------------------------------
;Bub Land
[Statedef 7131]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 7131
sprpriority = 3

[State 7131, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7131, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7131, 3]
type = PosSet
trigger1 = !Time
y = 0

[State 7131, 4]
type = NotHitBy
trigger1 = 1
value = SCA
time = -1

[State 7131, 5]
type = StopSnd
trigger1 = !Time
channel = 6

[State 7131, 6]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7131, 7]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7131, 8]
type = ChangeState
trigger1 = Time = 64
value = 7120 
;---------------------------------------------------------------------------
; HIT_LAND
[Statedef 7132]
type    = S
movetype= H
physics = N
velset = 0,0
ctrl = 0
anim = 7132
sprpriority = 3

[State 7132, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7131, 2]
type = ChangeState
trigger1 = Time = 30
value = 7120
;---------------------------------------------------------------------------
; Bub Dead
[Statedef 7140]
type    = U
movetype= H
physics = N
velset = 0,0
ctrl = 0
anim = 7140
sprpriority = 3

[State 7040, 1]
type = VelSet
trigger1 = StateType = A
y = 2*const(size.yscale)

[State 7040, 2]
type = StateTypeSet
trigger1 = StateType = A && Pos Y >= 0
statetype = S

[State 7040, 3]
type = VelSet
trigger1 = StateType = S
y = 0

[State 7040, 4]
type = PosSet
trigger1 = StateType = S
y = 0

[State 7040, 5]
type = PlaySnd
trigger1 = !Time
value = S7130,0

[State 7040, 6]
type = ChangeState
trigger1 = !AnimTime
value = 7300
;---------------------------------------------------------------------------
;NOVA Stand Summon (Entrance)
[Statedef 7200]
type    = A
movetype= I
physics = N
velset = ifelse(parent,FrontEdgeDist > 50,(ParentDist X)/15,(ParentDist X)/15),-3.33*const(size.yscale)
ctrl = 0
anim = 7200
sprpriority = 3

[State 7200, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7200, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7200, 4]
type = Null
trigger1 = !Time && RoundState = 2
var(7) = -100-(50*(root,Var(0) > 0))

[State 7200, 5]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7200, 6]
type = Gravity
trigger1 = 1

[State 7200, 7]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7200, 8]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7200, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7200, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7200, 11]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7201
;---------------------------------------------------------------------------
;NOVA Stand Summon (Throw)
[Statedef 7201]
type    = A
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7201
sprpriority = 3

[State 7201, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7201, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7201, 3]
type = Helper
trigger1 = AnimElem = 5
name = "Boomerang"
ID = 7050
stateno = 7202
pos = ceil(44*const(size.xscale)),ceil(-33*const(size.xscale))
postype = p1
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7201, 4]
type = ParentVarAdd
trigger1 = AnimElem = 5
var(39) = 1

[State 7201, 5]
type = VarAdd
trigger1 = AnimElem = 5
var(11) = 1

[State 7201, 6]
type = PosSet
trigger1 = !Time
y = 0

[State 7201, 7]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7201, 8]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7201, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7201, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7201, 11]
type = PlaySnd
trigger1 = !Time
value = S7201,0

[State 7201, 12]
type = PlaySnd
trigger1 = AnimElem = 3
value = S7201,1

[State 7201, 13]
type = ChangeState
trigger1 = !AnimTime
value = 7220
;---------------------------------------------------------------------------
;Boomerang
[Statedef 7202]
type    = S
movetype= A
physics = N
velset = 18.90*const(size.xscale),0
ctrl = 0
anim = 7202
sprpriority = 3

[State 7202, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7202, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7202, 3]
type = HitOverride
trigger1 = 1
attr = SCA,HP
stateno = 7203
time = -1

[State 7202, 4]
type = NotHitBy
trigger1 = 1
value = ,AA,NP,SP,AT
time = -1

[State 7202, 5]
type = HitDef
trigger1 = root,var(5) < 10 && !Time
attr = S, SP
damage = ceil(45*root,Fvar(21)),11
animtype = Hard
getpower = 0,0
givepower = 100, 0
guardflag = MAF
hitflag = MAF
priority = 4, Hit
pausetime = 1,1
sparkno = S6001
sparkxy = -9,0*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6, 0
ground.type = Low
ground.slidetime = 34
ground.hittime  = 36
ground.velocity = -8*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.velocity = -4.4*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
fall = 0
fall.recover = 0
id = 7050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7202, 5]
type = HitDef
triggerall = (!HitCount && parent,Var(5) < 10) || HitCount
trigger1 = Vel X < 0
attr = S, SP
damage = ceil(45*root,Fvar(21)),11
animtype = Hard
getpower = 0,0
givepower = 100, 0
guardflag = MAF
hitflag = MAF
priority = 4, Hit
pausetime = 1,1
sparkno = S6001
sparkxy = -9,0*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6, 0
ground.type = Low
ground.slidetime = 34
ground.hittime  = 36
ground.velocity = 8*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.velocity = 4.4*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
fall = 0
fall.recover = 0
id = 7050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
persistent = 0

[State 7202, 6]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1 && !Var(1)
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1

[State 7202, 7]
type = VarSet
triggerall = NumTarget && MoveHit && HitCount < 2
trigger1 = P2StateType = A && target,Time = 0
var(0) = 1
ignorehitpause = 1

[State 7202, 8]
type = VarSet
triggerall = NumTarget && Var(0)
trigger1 = target,Time
var(0) = 0
ignorehitpause = 1

[State 7202, 9]
type = VarAdd
trigger1 = NumTarget && MoveHit && !Var(1)
var(1) = 1

[State 7202, 10]
type = VarSet
trigger1 = !NumTarget && Var(1)
var(1) = 0

[State 7202, 11]
type = VelAdd
trigger1 = 1
x = -0.86

[State 7202, 12]
type = VelSet
trigger1 = Vel X < 0
y = (((parent,Pos Y - 70) - Pos Y) / 10)*const(size.yscale)

[State 7202, 13]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7202, 14]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7201, 15]
type = PlaySnd
trigger1 = !Time || (Time % 10) = 0
value = S7202,0
channel = 7

[State 7100, 16]
type = ChangeState
trigger1 = ParentDist X > -10 || BackEdgeDist < -30
value = 7204
;---------------------------------------------------------------------------
;Boomerang
[Statedef 7203]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7203
sprpriority = 3

[State 7203, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7203, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7203, 3]
type = ParentVarSet
trigger1 = !AnimTime 
var(10) = 1

[State 7203, 4]
type = ChangeAnim
trigger1 = !AnimTime 
value = 1

[State 7203, 5]
type = DestroySelf
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L 
;---------------------------------------------------------------------------
;Boomerang
[Statedef 7204]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 1
sprpriority = 3

[State 7203, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7203, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7203, 3]
type = ParentVarSet
trigger1 = 1
var(10) = 1

[State 7203, 5]
type = DestroySelf
trigger1 = Time

;---------------------------------------------------------------------------
;NOVA Crouch Summon (Entrance)
[Statedef 7210]
type    = S
movetype= I
physics = N
velset = ifelse(parent,FrontEdgeDist > 50,(ParentDist X)/15,(ParentDist X)/15),-3.33*const(size.yscale)
ctrl = 0
anim = 7200
sprpriority = 3

[State 7210, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7210, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7210, 3]
type = Null
trigger1 = !Time && RoundState = 2
var(7) = -150-(50*(root,Var(0) > 0))

[State 7210, 4]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7210, 5]
type = Gravity
trigger1 = 1

[State 7210, 6]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7210, 7]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7210, 8]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7210, 9]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7210, 10]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -Vel Y
value = 7211
;---------------------------------------------------------------------------
;NOVA Crouch Summon (Throw)
[Statedef 7211]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7211
sprpriority = 3

[State 7211, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7211, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7211, 3]
type = Helper
trigger1 = AnimElem = 5
name = "Grenade"
ID = 7050
stateno = 7212
pos = ceil(39*const(size.xscale)),ceil(-48*const(size.xscale))
postype = p1
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7211, 4]
type = ParentVarAdd
trigger1 = AnimElem = 5
var(39) = 1

[State 7211, 5]
type = VarAdd
trigger1 = AnimElem = 5
var(11) = 1

[State 7211, 6]
type = PosSet
trigger1 = !Time
y = 0

[State 7211, 7]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7211, 8]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7211, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7211, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7211, 11]
type = PlaySnd
trigger1 = !Time
value = S7201,0

[State 7211, 12]
type = PlaySnd
trigger1 = AnimElem = 3
value = S7201,1

[State 7211, 13]
type = ChangeState
trigger1 = !AnimTime
value = 7220
;---------------------------------------------------------------------------
;Grenade
[Statedef 7212]
type    = A
movetype= I
physics = N
velset = Cond(FrontEdgeDist < 80,Cond(P2Dist X < 0, (FrontEdgeDist)/41,(P2Dist X)/41),2.2),-5.5*const(size.yscale)
ctrl = 0
anim = 7212
sprpriority = 3

[State 7212, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7212, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7212, 3]
type = VelAdd
trigger1 = 1
y = .3*const(size.yscale)

[State 7212, 4]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7212, 5]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7212, 6]
type = StateTypeSet
trigger1 = Time = 40
movetype = A

[State 7212, 7]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -10 
value = 7213
;---------------------------------------------------------------------------
;Grenade
[Statedef 7213]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7213
sprpriority = 3

[State 7212, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7212, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7212, 3]
type = HitDef
trigger1 = root,var(5) < 10 && !Time
attr = S, SP
damage = ceil(250*root,Fvar(21)),63
animtype = Hard
getpower = 0,0
givepower = 100, 0
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 1,1
sparkno = S6001
sparkxy = -18,0
hitsound = F5,4
guardsound = F6, 0
ground.type = Low
ground.slidetime = 34
ground.hittime  = 36
ground.velocity = -.8*const(size.xscale), -32.5*const(size.yscale)
guard.velocity = -8.5
ground.cornerpush.veloff = 0
air.type = Low
air.velocity = -.5*const(size.xscale), -28.2*const(size.yscale)
air.hittime = 100
fall = 1
fall.recover = 0
yaccel = .7*const(size.yscale)
id = 7050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7212, 4]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7212, 5]
type = EnvColor
trigger1 = !Time
value = 255,255,255
time = 1

[State 7212, 6]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7212, 7]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y

[State 7212, 8]
type = VarSet
triggerall = NumTarget && MoveHit && HitCount < 2
trigger1 = P2StateType = A && target,Time = 0
var(0) = 1
ignorehitpause = 1

[State 7212, 9]
type = VarSet
triggerall = NumTarget && Var(0)
trigger1 = target,Time
var(0) = 0
ignorehitpause = 1

[State 7212, 10]
type = Explod
trigger1 = Time = 2 ;|| Time = 18 || Time = 34
anim = 7203
ID = 7200
pos = ceil(40-(80*(Time = 18))*const(size.xscale)),ceil(-32+(64*(Time = 18))*const(size.yscale))
postype = p1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1

[State 7212, 11]
type = Explod
trigger1 = Time = 4 ;|| Time = 20 || Time = 36
anim = 7203
ID = 7200
pos = ceil(-28+(64*(Time = 20))*const(size.xscale)),ceil(-64+(128*(Time = 20))*const(size.yscale))
postype = p1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1

[State 7212, 12]
type = Explod
trigger1 = Time = 8 ;|| Time = 24 || Time = 40
anim = 7203
ID = 7200
pos = ceil(4-(8*(Time = 24))*const(size.xscale)),ceil(-48+(96*(Time = 24))*const(size.yscale))
postype = p1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1

[State 7212, 13]
type = Explod
trigger1 = Time = 10 ;|| Time = 26 || Time = 42
anim = 7203
ID = 7200
pos = ceil(-32+(64*(Time = 26))*const(size.xscale)),ceil(8-(16*(Time = 26))*const(size.yscale))
postype = p1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1

[State 7212, 14]
type = Explod
trigger1 = Time = 12 ;|| Time = 28 || Time = 44
anim = 7203
ID = 7200
pos = ceil(32-(64*(Time = 28))*const(size.xscale)),ceil(-56+(112*(Time = 28))*const(size.yscale))
postype = p1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1

[State 7212, 12]
type = Null
trigger1 = Time = 16 || Time = 32 || Time = 48
anim = 7203
ID = 7200
pos = 0,ceil(0-(64*(Time = 32))*const(size.yscale))
postype = p1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1

[State 7212, 15]
type = PlaySnd
trigger1 = !Time
value = S7213,0

[State 7212, 16]
type = ParentVarSet
trigger1 = !AnimTime 
var(10) = 1

[State 7212, 17]
type = DestroySelf
triggerall = Time
trigger1 = !AnimTime

;---------------------------------------------------------------------------
;NOVA Leave
[Statedef 7220]
type    = S
movetype= I
physics = N
velset = -5.04*const(size.yscale)
ctrl = 0
anim = 7220
sprpriority = 3

[State 7220, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7220, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7220, 3]
type = VelSet
trigger1 = !Time
x = -10*const(size.xscale)
y = -9.13*const(size.yscale)

[State 7220, 4]
type = PlaySnd
trigger1 = !Time
value = S7201,0

[State 7220, 5]
type = ChangeState
trigger1 = BackEdgeDist < -30*const(size.xscale)
value = 7300
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 7230]
type    = U
movetype= H
physics = N
ctrl = 0
anim = 7230
velset = -1.2*const(size.xscale),-7*const(size.yscale)
sprpriority = 3

[State 7230, 1]
type = VelAdd
trigger1 = 1
y = .44*const(size.yscale)

[State 7230, 4]
type = PlaySnd
trigger1 = !Time
value = S7230,0

[State 7230, 5]
type = ParentVarAdd
trigger1 = !Time && RoundState = 2
var(6) = -100
ignorehitpause = 1

[State 7230, 6]
type = PlaySnd
trigger1 = !Time
value = S7230,0

[State 7230, 7]
type = ChangeState
trigger1 = root,Var(6) = 0
value = 7240

[State 7230, 8]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 7231
;---------------------------------------------------------------------------
; HIT_LAND
[Statedef 7231]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0
anim = 7231
sprpriority = 3

[State 7131, 1]
type = ChangeState
trigger1 = !AnimTime
value = 7220
;---------------------------------------------------------------------------
;NOVA Dead
[Statedef 7240]
type    = U
movetype= H
physics = N
ctrl = 0
anim = 7240
velset = 0,0
sprpriority = 3

[State 7240, 1]
type = PlaySnd
trigger1 = !Time
value = S7240,0

[State 7240, 2]
type = ChangeState
trigger1 = Time = 128
value = 7300
;---------------------------------------------------------------------------
;Helper Gone
[Statedef 7300]
type    = U
movetype= H
physics = N
ctrl = 0
anim = 1
velset = 0,0
sprpriority = 3

[State 7300, 1]
type = ParentVarSet
trigger1 = Var(11) = Var(10)
var(39) = 0
ignorehitpause = 1

[State 7300, 2]
type = ParentVarSet
trigger1 = !Time
var(38) = 0
ignorehitpause = 1

[State -2, Debug]
type = DisplaytoClipboard
trigger1 = 1
text = "Vel: x = %d y = %d"
params = Var(10), Var(11)
ignorehitpause = 1

[State 7300, 4]
type = DestroySelf
triggerall = !(root,Var(38)) && !(root,Var(39))
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
